<?php

/**
 * server actions.
 *
 * @package    keygenius
 * @subpackage server
 * @author     Dain Nilsson
 * @version    SVN: $Id: actions.class.php 12479 2008-10-31 10:54:40Z fabien $
 */
class serverActions extends sfActions {
  public function executeIndex(sfWebRequest $request) {
    if(!$request->isSecure()) $this->redirect(str_replace('http://', 'https://', $request->getUri()));

    $response = $this->getResponse();
    $response->setContentType('application/json');
    $data = KeyGenius::processAjaxRequest($request->getParameterHolder()->getAll());
    if($data) $response->setContent($data);
    else $this->forward404();
    return sfView::NONE;
  }
}
